package demo;

import java.io.File;

public class ListFileDemo {

	public static void main(String[] args) {
		String path = "D:"+File.separator+"test";
		File file = new File(path);
		listFiles(file);

	}
	
	public static void listFiles(File f){
		if(f!=null){
			if(f.isDirectory()){
				File files[] = f.listFiles();
				if(files!=null){
					for (int i = 0; i < files.length; i++) {
						listFiles(files[i]);
					}
					
				}
				
			}else{
				System.out.println(f);
				
			}
			
			
			
		}
		
		
	}

}
